package daythree;

import java.io.Serializable;

public class Person implements Serializable {
    /**
     * 先创建人的属性、属性含有id、left、right
     */
    private int id;

    private Person left;

    private Person right;

    /**
     * 这里先获取人的ID
     * @return
     */
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }


    /**
     * 获取人的左边
     * @return
     */
    public Person getLeft(){
        return left;
    }

    public void setLeft(Person left) {
        this.left = left;
    }

    /**
     * 获取人的右边
     * @return
     */
    public Person getRight() {
        return right;
    }

    public void setRight(Person right) {
        this.right = right;
    }

    @Override
    public String toString(){
        return "Person("+"此人的"+id+")";
    }
}
